<?php
namespace app\article\validate;

use think\Request;
use think\Validate;

class Instance extends Validate
{

    protected $rule = [
        'id|案例信息' =>'require|integer',
        'site_id|站点标识' => 'require|max:20',
        'title|标题' => 'require|max:25',
        'content|内容' => 'require',
        'head_img|封面图片' => 'require',
        'sort|排序数' => 'require|number|between:0,100',
        'status|是否发布' => 'require|in:0,1',

    ];

    /**
     * 验证场景
     * @var [type]
     */
    protected $scene =[
        'create' => ['head_img','site_id','title','content','sort','status'],
        'edit' => ['id','site_id','title','head_img','content','sort','status'],
        'del' => ['id'],
    ];

}